import re

pattern1 = r'\d*' #无捕获组
pattern2 = r'(\d*)' #有捕获组
text = '12345678'

match1 = re.match(pattern1,text)
match2 = re.match(pattern2,text)

print(match1.group()) 
print(match1.group(0))
#print(match1.group(1)) #报错

print(match2.group())
print(match2.group(0))
print(match2.group(1))
